<template>
  <div class="tile">
    <div class="tile-header">
      <!-- partial:index.partial.html -->
      <section>
        <div class="container">
          <div class="form sign-in-form">
            <div class="wrapper">
              <form action="#">
                <h1>Sign In</h1>
                <p>use your email and password to sign in</p>
                <input type="email" placeholder="Email" />
                <input type="password" placeholder="password" />
                <button>Sign In</button>
              </form>
            </div>
          </div>
          <div class="form sign-up-form active">
            <div class="wrapper">
              <form action="#">
                <h1>Sign up</h1>
                <p>Please, provide all the correct info to create an account</p>
                <input type="text" placeholder="Full Name" />
                <input type="email" placeholder="Email" />
                <input type="password" placeholder="password" />
                <button>Sign Up</button>
              </form>
            </div>
          </div>
          <div class="overlay-container">
            <div class="overlay">
              <div class="overlay-left">
                <h1>Create Account</h1>
                <p>or</p>
                <button id="signInButton">Log In</button>
              </div>
              <div class="overlay-right">
                <h1>Please, Log In</h1>
                <p>or</p>
                <button id="signUpButton">Create Account</button>
              </div>
            </div>
          </div>
        </div>
      </section>

      <!-- *******************   -->
      <!--  This Code is for only the floating card in right bottom corner -->
      <!-- ********************  -->

      <div id="webCifar-sidebox"></div>
    </div>
  </div>

  <!-- <header class="header">
    <div class="circle c1"></div>
    <div class="circle c2"></div>
    <h1 class="logo">
      <img
        src="../assets/MedCheng-logo.png"
        style="width: 100%; height: 100%"
      />
    </h1>
    <h1 class="slogan">
      技术为基础，以优质服务为载体， 全心全意为病人服务。 醫成通系统欢迎您！
      <span class="ps"></span>
    </h1>
    <div style="margin-top: 180px"></div>
    <div class="hill"></div>
  </header> -->
</template>

<script>
import { useRouter } from "vue-router";
import { reactive } from "vue";
import api from "@/http/api";
export default {
  name: "login",
  setup() {
    const $router = useRouter();
    const formLabelAlign = reactive({
      phone: "19808006488",
      password: "123456",
      authCode: "",
    });
    function login() {
      api({
        url: "/login",
        method: "post",
        params: {
          phone: formLabelAlign.phone,
          password: formLabelAlign.password,
        },
      }).then((res) => {
        console.log(res);
        $router.replace("/backgroundHome");
      });
    }
    function authCodeLogin() {
      $router.replace("/backgroundHome");
    }

    return { formLabelAlign, login, authCodeLogin };
  },
  data() {
    return {
      passwordLoginShow: true,
      authCodeLoginShow: false,
      state: "发送验证码",
    };
  },
  methods: {
    sendAuthCode() {
      console.log(this.formLabelAlign.phone);
      api({
        url: "/msm/send?phone=" + this.formLabelAlign.phone,
        method: "post",
      }).then((res) => {
        console.log(res);
        this.state = "发送成功！";
      });
    },
  },
};
</script>

<style scoped>
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");
@import url("../style/login.css");
.header {
  position: relative;
  background: linear-gradient(#e8eef2, #d3dde4);
  overflow: hidden;
  user-select: none;
}

.logo {
  position: relative;
  width: 20rem;
  height: 14.5rem;
  opacity: 0;
  transform: rotate(-2turn) scale(0);
  -webkit-animation: fade-content 1s 1.2s cubic-bezier(0.2, 1, 0.2, 1) forwards;
  animation: fade-content 1s 1.2s cubic-bezier(0.2, 1, 0.2, 1) forwards;
}

.arrow {
  position: absolute;
  width: 100%;
  height: 100%;
  font-size: 18px;
  opacity: 0;
  transform: scale(1.7);
  -webkit-animation: fade-content 0.5s 2.2s cubic-bezier(0.2, 1, 0.2, 1)
    forwards;
  animation: fade-content 0.5s 2.2s cubic-bezier(0.2, 1, 0.2, 1) forwards;
}
.arrow::before,
.arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-top: 1.5em solid transparent;
}
.arrow::before {
  border-right: 1em solid #c7deef;
  transform-origin: 100% 0;
  transform: translate(calc(-100%), -75%) skewY(-25deg);
}
.arrow::after {
  border-left: 1em solid #5a7695;
  transform-origin: 0 0;
  transform: translate(1px, -75%) skewY(25deg);
}

.slogan {
  /* 630 */
  max-width: 470px;
  /* margin: 0 auto 3.5rem; */
  margin-left: 50px;
  color: #023161;
  font: 100 26px/1.5 sans-serif;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  text-transform: capitalize;
  opacity: 0;
  transform: perspective(800px) rotateX(-60deg) translateY(50px);
  -webkit-animation: fade-content 0.85s 2.1s cubic-bezier(0.2, 1, 0.2, 1)
    forwards;
  animation: fade-content 0.85s 2.1s cubic-bezier(0.2, 1, 0.2, 1) forwards;
}
.slogan .ps {
  color: #fff;
  text-transform: lowercase;
  text-shadow: 0 1px 2px rgba(0, 30, 50, 0.15);
}

.btns {
  margin-bottom: 5rem;
}

.btn {
  position: relative;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.25rem;
  outline: none;
  font-size: 14px;
  text-transform: capitalize;
  color: #008cdd;
  background: linear-gradient(#fff, rgba(255, 255, 255, 0.9));
  text-shadow: 0 1px 0 #fff;
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 4px rgba(23, 78, 138, 0.1),
    0 4px 20px -2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  transform: perspective(800px) rotateX(-50deg) translateY(30px);
  -webkit-animation: fade-content 0.7s 2.2s forwards;
  animation: fade-content 0.7s 2.2s forwards;
}
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  color: rgba(0, 0, 0, 0.2);
  opacity: 0;
  box-shadow: 0 4px 20px -2px;
  transition-duration: 0.4s;
}
.btn:hover::before {
  opacity: 1;
}
.btn--primary {
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px -1px rgba(0, 0, 0, 0.4);
  background: #123159 linear-gradient(#123159, #0f294d);
}
.btn--primary::before {
  color: rgba(0, 0, 0, 0.3);
}
.btn ~ .btn {
  margin-left: 1.5em;
  -webkit-animation-delay: 2.4s;
  animation-delay: 2.4s;
}

.circle {
  position: absolute;
  top: calc(50% - 10vw);
  left: calc(50% - 50vw);
  width: 200vw;
  height: 200vw;
  border-radius: 50%;
  background-color: rgba(255, 0, 0, 0.1);
  background-image: linear-gradient(
    45deg,
    rgba(255, 179, 103, 0.75) 55%,
    rgba(185, 93, 215, 0.75),
    rgba(0, 215, 185, 0.75) 72%
  );
  transform: translate(100%, 500px);
  -webkit-animation: fade-content 1.2s 0.7s cubic-bezier(0.2, 1, 0.2, 1)
    forwards;
  animation: fade-content 1.2s 0.7s cubic-bezier(0.2, 1, 0.2, 1) forwards;
  mix-blend-mode: darken;
}
.circle.c2 {
  top: calc(50% - 1vw);
  left: calc(50% - 90vw);
  width: 250vw;
  height: 250vw;
  background-image: linear-gradient(
    45deg,
    rgba(255, 207, 159, 0.75) 62.5%,
    rgba(206, 151, 223, 0.75),
    rgba(141, 198, 216, 0.75) 70%
  );
  -webkit-animation-delay: 0.5s;
  animation-delay: 0.5s;
}

.hill {
  position: relative;
  height: 8.5rem;
  overflow: hidden;
}
.hill::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  top: 1rem;
  left: 50%;
  width: 1000vw;
  height: 1000vw;
  transform: translate(calc(-50% + 35vw), 0);
  background-color: #fff;
  color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 0.5rem, 0 0 2rem, 0 0 3rem;
}

@-webkit-keyframes fade-content {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-content {
  to {
    opacity: 1;
    transform: none;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  padding-top: 1px;
  padding-bottom: 5rem;
  text-align: center;
  overflow-y: scroll;
}

.info {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 1em;
  font-size: 0.9em;
  font-style: italic;
  font-family: serif;
  text-align: right;
  opacity: 0.5;
}
.info a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ----------------------------------------------------------------------------------- */
.tile {
  /* background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2),
    0 0.25rem 0.25rem rgba(0, 0, 0, 0.2);
  position: absolute;
  right: 210px;
  top: 15px;
  width: 100%;
  min-width: 320px;
  max-width: 24rem;
  transform: translate(0%, 20%);
  animation: mymove 1s ease-in-out alternate;
  overflow: hidden;
  transition: 1.5s;
  z-index: 9; */
}

.tile-header {
  padding: 2rem 0rem 1rem 0rem;
}

.tile .tile-body {
  padding: 0rem 2rem 2rem 2rem;
}

/**
 * Forms
 */
.form-input {
  display: block;
  position: relative;
  margin-bottom: 1rem;
}

.form-input > .material-icons {
  position: absolute;
  font-size: 1.5rem;
  top: 1.2rem;
}

.form-input > .material-icons ~ input,
.form-input > .material-icons ~ .label,
.form-input > .material-icons ~ .underline {
  margin-left: 2.25rem;
  width: calc(100% - 2.25rem);
}

.form-input input {
  border: none;
  box-shadow: none;
  padding-top: 1.5rem;
  padding-right: 0;
  padding-bottom: 0.5rem;
  padding-left: 0;
  outline-style: none;
  width: 100%;
}

.form-input input ~ .label {
  color: #868e96;
  font-size: 1rem;
  margin: 0;
  pointer-events: none;
  position: absolute;
  top: 1.5rem;
  left: 0;
  transition: top 0.2s, font 0.2s;
  z-index: 1;
}

.form-input input ~ .underline {
  background-color: #bdc1c5;
  height: 1px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
}

.form-input input:hover ~ .underline,
.form-input input:focus ~ .underline {
  background-color: #07beb8;
}

.form-input input:hover ~ .label,
.form-input input:focus ~ .label {
  color: #07beb8;
}

.form-input input:focus ~ .underline {
  height: 2px;
}

.form-input input:focus ~ .label,
.form-input input:valid ~ .label {
  top: 0;
  font-size: 0.85rem;
}

.form-input input:-webkit-autofill ~ .label {
  top: 0;
  font-size: 0.85rem;
}

/**
 * Utilities
 */
.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

.float-right {
  float: right;
}

.btn_dz {
  width: 100px;
  height: 40px;
  border-radius: 5px;
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
</style>